# !/usr/bin/env python
# -*-coding:utf-8 -*-
from rest_framework import serializers

from apps.bottles.models import Bottle


class BottleModelSerializer(serializers.ModelSerializer):

    class Meta:
        model = Bottle
        fields = ["id", "title", "content", "likes", "views", "is_flowing",
                  "owner_id", "pre_owner_id", "create_user_id", "update_user_id"]
        extra_kwargs = {
            "owner_id": {"required": False, "write_only": True},
            "pre_owner_id": {"required": False, "write_only": True},
            "create_user_id": {"required": False, "write_only": True},
            "update_user_id": {"required": False, "write_only": True},
            "is_flowing": {"required": False, "write_only": True},
        }

